<template>
	<div class="schools" @click=schoolDetails($event)>
		<no-data v-show='no_data'></no-data>
		<ul>
		    <li v-for='school of schools'>
		    	<div class="school-logo">
		    		<img :src="logo+school.logo" alt="logo" title="logo" />
		    	</div>
		    	<div class="school-info">
		    		<span class="school-name" :school-id=school.id>{{school.school_name}}</span>
		    		<span class="city-name icon-shengfen" v-if='show'>{{school.city_name}}</span>
		    		<br>
		    		<span v-if='!show' class='five'>
			    		<span>毕业5年月薪：<span>&yen;{{school.five}}</span></span>
			    		<span>最多去向城市：<span>{{school.area_name}}{{school.bili}}%</span></span>
	    			</span>
		    		<span class="school-type"
	    				v-if='show'
						v-if='school.stype.length>0'
						v-for='type of school.stype'
						v-show=type>{{type}}</span>
	    			<span class="school-salary" v-if='show'>薪酬超过{{school.salary}}%的学校</span>
		    		<div class="school-rank">
		    			<span class="school-ranking">综合排名：<span>{{show?school.ranking:school.sort}}</span></span>
		    			<span class="school-attention"
		    				v-if='show'
		    				:class='school.status==0? "icon-notcollect":"icon-collect"'></span>
		    		</div>
		    	</div>
		    </li>
		</ul>
	</div>
</template>
<script>
	'use strict';
function fn30(d){
	jcy.use('jcyer',function(){
		jcy.jcyer({
			skin:1,
			content:d.msg
		})
	})
}
module['base-schoollist'] = {
	props: ['schools'],
	template: template,
	data: function data() {
		return {
			show: 1,
			logo: base.api('logo'),
			no_data: false
		};
	},
	methods: {
		schoolDetails: function schoolDetails(e) {
			var tar = e.target;
			if (tar.className.indexOf('school-name') > -1) {
				var index = $('.neibu_tab li.active').index();
				var url = '/info' + '?school-id=' + tar.getAttribute('school-id') + '&collage&index=0';
				//					window.open(window.location.origin + '/index.html#/'+url)
				this.$router.push({ path: url });
			} else if (tar.className.indexOf("collect") > -1) {
				var id = $(tar).parents('.school-info').find('.school-name').attr('school-id');
				if (tar.className.indexOf("notcollect") > -1) {
					base.request(base.api(30), { type: "school", id: id }, function (data) {
						tar.className = tar.className.replace('notcollect', 'collect');
						fn30(data);
					});
				} else {
					tar.className = tar.className.replace('collect', 'notcollect');
					base.request(base.api(30), { type: "school", id: id }, fn30,fn30);
				}
			}
		}
	}
};
</script>
